package day3.homework;
//插入排序
public class Work1 {
    public static void main(String[] args) {
        int[] value = {6,11,4,8,1};
        for (int i = 1; i < value.length; i++) {
            int temp = value[i];
            int j = i-1;
            while (j >= 0 && value[j]>temp){
               value[j+1] = value[j];
               j--;
            }
            value[j+1] = temp;
        }
        for (int i = 0; i < value.length; i++) {
            System.out.println(value[i]);
        }
    }
}
